package cn.hg.solon.youcan.system.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;

// Auto generate by mybatis-flex, do not modify it.
public class SysUserLoginTableDef extends TableDef {

    /**
     * 实体类。

 @author 胡高
 @since 2023-06-20
     */
    public static final SysUserLoginTableDef SYS_USER_LOGIN = new SysUserLoginTableDef();

    /**
     * ID
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 登录IP
     */
    public final QueryColumn IP = new QueryColumn(this, "ip");

    /**
     * 操作系统
     */
    public final QueryColumn OS = new QueryColumn(this, "os");

    /**
     * 提示消息
     */
    public final QueryColumn MSG = new QueryColumn(this, "msg");

    /**
     * 任务状态：SUCCESS 成功，FAIL 失败
     */
    public final QueryColumn STATUS = new QueryColumn(this, "status");

    /**
     * 账号
     */
    public final QueryColumn ACCOUNT = new QueryColumn(this, "account");

    /**
     * 浏览器类型
     */
    public final QueryColumn BROWSER = new QueryColumn(this, "browser");

    /**
     * 登录地点
     */
    public final QueryColumn LOCATION = new QueryColumn(this, "location");

    /**
     * 昵称
     */
    public final QueryColumn NICKNAME = new QueryColumn(this, "nickname");

    /**
     * 访问时间
     */
    public final QueryColumn LOGIN_DATETIME = new QueryColumn(this, "login_datetime");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, IP, OS, MSG, STATUS, ACCOUNT, BROWSER, LOCATION, NICKNAME, LOGIN_DATETIME};

    public SysUserLoginTableDef() {
        super("", "sys_user_login");
    }

    private SysUserLoginTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public SysUserLoginTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new SysUserLoginTableDef("", "sys_user_login", alias));
    }

}
